<template>
  <div class="contentBox">
    <a-spin :spinning="loading" size="large" tip="Loading...">
      <a-row type="flex" justify="start" :gutter="16">
        <a-col :sm="24" :lg="18">
          <a-card>
            <div class="leftInfo">
              <!-- 常用功能 -->
              <div class="commonFunctions">
                <ul class="commonFunctionsList">
                  <template v-if="commonFunctionsList.length>0">
                    <li class="commonFunctionsInfo" v-for="item in commonFunctionsList" key="item.id">
                      <router-link class="routerLink" :to="item.url">
                        <div class="commonFunctionsTag">
                          <Icon class="routerLinkIcon" v-if="item.icon" :icon="item.icon" :size="30" />
                          <!-- <FileDoneOutlined v-else class="routerLinkIcon" /> -->
                          <SolutionOutlined v-else class="routerLinkIcon"/>
                        </div>
                        <span>{{ item.name }}</span>
                      </router-link>
                    </li>
                  </template>
                  <li class="addNewFunctions" @click="addCommonFunctions">
                    <div class="addNewFunctionsInfo">
                      <div class="addNewFunctionsInfoTag"> </div>
                      <span>添加</span>
                    </div>
                  </li>
                </ul>
              </div>
              <!-- 个人工作量统计 -->
              <template v-if="stateInfo===1||stateInfo===3">
                <div class="taskStatistics">
                  <!-- 标题 -->
                  <h2 class="taskStatisticsTitle">个人工作量统计</h2>
                  <!-- 数量 -->
                  <a-row type="flex" justify="start" :gutter="16" class="counting">
                    <a-col :sm="24" :md="8" :lg="8">
                      <div class="countBox green">
                        <div class="averageBox">
                          <div class="leftContentIcon tobeTestIcon"></div>
                          <div class="centerContentInfo">
                            <p class="centerContentInfoText">待检项目数</p>
                            <p class="centerContentInfoNumber">{{ personalWorkloadList.waitNum }}<span class="unit">个</span> </p>
                          </div>
                        </div>
                        <div class="averageBox">
                          <div class="leftContentIcon currentTextIcon"></div>
                          <div class="centerContentInfo">
                            <p class="centerContentInfoText">当月检测数</p>
                            <p class="centerContentInfoNumber">{{ personalWorkloadList.monthNum }}<span class="unit">个</span> </p>
                          </div>
                        </div>
                      </div>
                    </a-col>
                    <a-col :sm="24" :md="8" :lg="8">
                      <div class="countBox yellowGreen">
                        <div class="averageBox">
                          <div class="leftContentIcon currentTestTimeIcon"></div>
                          <div class="centerContentInfo">
                            <p class="centerContentInfoText">当月实验时间</p>
                            <p class="centerContentInfoNumber">{{ personalWorkloadList.monthTime }}<span class="unit">小时</span></p>
                          </div>
                        </div>
                        <div class="averageBox">
                          <div class="leftContentIcon currentWorkOvertimeIcon"></div>
                          <div class="centerContentInfo">
                            <p class="centerContentInfoText">当月加班时间</p>
                            <p class="centerContentInfoNumber">{{ personalWorkloadList.overTime }}<span class="unit">小时</span> </p>
                          </div>
                        </div>
                      </div>
                    </a-col>
                    <a-col :sm="24" :md="8" :lg="8">
                      <div class="countBox blue">
                        <div class="averageBox">
                          <div class="leftContentIcon accumulateTestIcon"></div>
                          <div class="centerContentInfo">
                            <p class="centerContentInfoText">累计检测数</p>
                            <p class="centerContentInfoNumber">{{ personalWorkloadList.allNum }} <span class="unit">个</span> </p>
                          </div>
                        </div>
                        <div class="averageBox" style="padding-left: 6%">
                          <div class="leftContentIcon accumulateTestTimeIcon"></div>
                          <div class="centerContentInfo">
                            <p class="centerContentInfoText">累计实验时间</p>
                            <p class="centerContentInfoNumber">{{ personalWorkloadList.totalTime }}<span class="unit">小时</span></p>
                          </div>
                        </div>
                      </div>
                    </a-col>
                  </a-row>
                  <div class="taskBox">
                    <!-- 进行中任务 -->
                    <div class="taskProcess">
                      <div class="chartsBox">
                        <div class="titleText">每月实验数</div>
                        <div class="echarts">
                          <HomeBar :flag="flag1" :chartData="monthNumberList"></HomeBar>
                        </div>
                      </div>
                    </div>
                    <a-select class="selectInfo" v-model:value="value" label-in-value :options="options" @change="handleChange"> </a-select>
                    <!-- 已完成情况 -->
                    <div class="taskCompleted">
                      <div class="chartsBox">
                        <div class="titleText">每月实验时间</div>
                        <div class="echarts">
                          <HomeBar ref="monthTimeBar" :flag="flag2" :chartData="monthTimeList"></HomeBar>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <!-- 下方其他信息 -->
                <div class="bottomOtherInfo">
                  <!-- 消息相关信息 -->
                  <!-- <div class="messageRelated"> -->
                  <!--  左侧预警信息 -->
                  <div class="warnInfo">
                    <h2 class="taskStatisticsTitle"><i class="title-icon"></i>消息通知<a class="moreLink" @click="gotoMessageList">更多 &gt;</a></h2>
                    <ul class="infoList">
                      <li v-if="messageInfoList.length === 0" class="infoItem"><a-empty /></li>
                      <li v-else class="infoItem" v-for="(item) in messageInfoList.slice(0, 5)" :key="item.id" @click="goMessageDetail(item.id)">
                        <!-- <li class="infoItem" v-for="item in messageInfoList" :key="item.id" @click="goMessageDetail(item)"> -->
                        <p class="leftText"
                          ><span :class="{ unread: item.notStatus == '未读' }">【{{ item.notStatus }}】</span>{{ item.taskName }}</p
                        >
                        <span class="rightTime">{{ item.pubTime.split(' ')[0] }}</span>
                      </li>
                    </ul>
                  </div>
                  <!-- 右侧通知公告 -->
                  <div class="noticeAnnouncement">
                    <h2 class="taskStatisticsTitle"><i class="title-icon"></i>通知公告<a class="moreLink" @click="gotoNoticeInfoList">更多 &gt;</a></h2>
                    <ul class="infoList">
                      <li v-if="noticeInfoList.length === 0" class="infoItem"><a-empty /></li>
                      <li v-else class="infoItem" v-for="(item) in noticeInfoList.slice(0, 5)" :key="item.id" @click="gotoNoticeDetail(item.id)">
                        <!-- <li class="infoItem" v-for="item in noticeInfoList" :key="item.id" @click="gotoNoticeDetail(item.id)"> -->
                        <p class="leftText">
                          <span :class="{ branchNotice: item.msgUrgency == '紧急', notice: item.msgUrgency == '一般' }">
                            【{{ item.msgUrgency }}】
                          </span>
                          {{ item.titile }}
                        </p>
                        <span class="rightTime">{{ item.sendTime.split(' ')[0] }}</span>
                      </li>
                    </ul>
                  </div>
                  <!-- 文档中心 -->
                  <div class="documentCenter">
                    <a-tabs v-model:activeKey="activeKey">
                      <a-tab-pane key="1" tab="管理类">
                        <ul class="infoList">
                          <li v-if="manageDocumentList.length === 0" class="infoItem"><a-empty /></li>
                          <li
                            v-else
                            class="infoItem"
                            v-for="(item) in manageDocumentList.slice(0, 5)"
                            :key="item.id"
                            @click="manageDocumentDetail(item)"
                          >
                            <p class="leftText">
                                <a-tooltip>
                                <template #title>{{ item.displayName }}</template>
                                {{ item.displayName }}
                              </a-tooltip>
                            </p>
                            <span class="rightTime">{{
                              item.updateTime != '' && item.updateTime != null ? item.updateTime.split(' ')[0] : item.createTime.split(' ')[0]
                            }}</span>
                          </li>
                        </ul>
                      </a-tab-pane>
                      <a-tab-pane key="2" tab="技术类">
                        <ul class="infoList">
                          <li v-if="technicalDocumentList.length === 0" class="infoItem"><a-empty /></li>
                          <li
                            v-else
                            class="infoItem"
                            v-for="(item) in technicalDocumentList.slice(0, 5)"
                            :key="item.id"
                            @click="technicalDocumentDetail(item)"
                          >
                            <p class="leftText">
                                <a-tooltip>
                                <template #title>{{ item.displayName }}</template>
                                {{ item.displayName }}
                              </a-tooltip>
                            </p>
                            <span class="rightTime">{{
                              item.updateTime != '' && item.updateTime != null ? item.updateTime.split(' ')[0] : item.createTime.split(' ')[0]
                            }}</span>
                          </li>
                        </ul>
                      </a-tab-pane>
                    </a-tabs>
                  </div>
                  <!-- </div> -->
                </div>
              </template>
              <template v-else>
                <div class="leaderBox">
                  <LeaderWorkInfo></LeaderWorkInfo>
                </div>
              </template>
            </div>
          </a-card>
        </a-col>
        <a-col :sm="24" :lg="6">
          <a-card>
            <div class="rightInfo">
              <h2 class="taskStatisticsTitle">
                <i class="title-icon"></i>待办任务
                <a class="moreLink" @click="gotodoTasksList">更多 &gt;</a>
              </h2>
              <!-- 顶部待办事项日历 -->
              <div class="weekly-calendar">
                <a-calendar v-model:value="calendarValue" :fullscreen="false" @change="changeDate">
                  <template #headerRender="">
                    <div class="timeShowText">{{ calendarYear }}年 {{ calendarMouth }}月</div>
                  </template>
                  <template #dateCellRender="{ current: value }">
                    <span class="events" v-for="item in getListData(value)" :key="item.content">
                      <!-- <a-badge :status="item.type" :text="item.content" /> -->
                      <span class="waitTodoTag"></span>
                    </span>
                  </template>
                </a-calendar>
              </div>
              <p class="lineBorder"></p>
              <!--任务 -->
              <div class="taskList">
                <template v-if="currentDateTodoTasksList.length > 0">
                  <div v-for="item in currentDateTodoTasksList" :key="item.id">
                    <div class="taskItem" :class="{ finishTask: item.finish === 1 }" @click="goItems(item)">
                      <div class="leftLineIcon"></div>
                      <div class="headInfo">
                        <span class="deliveryTimeIcon"></span>
                        <span class="deliveryTime">{{ item.pubTime }}</span>
                      </div>
                      <div class="otherInfo">{{ item.taskName }}</div>
                    </div>
                  </div>
                </template>
                <!-- 暂无更多待办事项 -->
                <div class="nodataStatus" v-else>
                  <p>暂无更多待办事项，休息一下吧！</p>
                </div>
              </div>
            </div>
          </a-card>
        </a-col>
      </a-row>
    </a-spin>
  </div>
  <!-- 打开弹窗，选择常用功能 -->
  <CommonFunctionsModal @updateCommonFunctions="getHasCommonFunctionsList" @register="register"></CommonFunctionsModal>
</template>
<script lang="ts" setup>
  import { ref } from 'vue';
  import HomeBar from './components/HomeBar.vue';
  import { Moment } from 'moment';
  import moment from 'moment';
  import {
    getStatisticsInfo,
    getNoticeInfo,
    getMessageInfo,
    getTodoTasksInfo,
    getStatisticsInfoList,
    update,
    manageDocument,
    technicalDocument,
    hasCommonFunctionsList,
  } from '../api.ts';
  import { useUserStore } from '/@/store/modules/user';
  import { useRouter } from 'vue-router';
  // import { SelectTypes } from 'ant-design-vue/es/select';
  import CommonFunctionsModal from './components/CommonFunctionsModal.vue';
  import { SolutionOutlined  } from '@ant-design/icons-vue';
  import { useModal } from '/@/components/Modal';
  import Icon from '/@/components/Icon/index';
  import LeaderWorkInfo from './components/LeaderWorkInfo.vue';

  
  const { userInfo }:any = useUserStore();
  const stateInfo = ref(userInfo.userIdentity);


  // const getIcon = computed(() => props.item?.icon);
  // 常用功能列表
  let commonFunctionsList = ref<any>([]);
  let loading = ref(false);
  //文档中心
  const manageDocumentList = ref<any>([]);
  const technicalDocumentList = ref<any>([]);
  //文档类数据
  let activeKey = ref('1');
  //注册model
  const [register, { openModal }] = useModal();
  // 获取已有的常用功能
  const getHasCommonFunctionsList = async () => {
    const result = await hasCommonFunctionsList();
    if (result.code === 200) {
      if (result.result === '暂时未添加常用模块') {
      } else {
        commonFunctionsList.value = result.result;
      }
    }
  };
  //点击新增常用功能事件回调
  const addCommonFunctions = () => {
    openModal(true, {
      commonFunctionsList:commonFunctionsList.value
    });
  };
  // 点击文档中心事件回调
  //管理类文档跳转至详情
  const manageDocumentDetail = (item) => {
    localStorage.setItem('manageDocumentDetail', JSON.stringify(item));
    router.push({ path: '/lab/documents/LabDoc' });
  };
  // 技术类文档跳转至详情打开
  const technicalDocumentDetail = (item) => {
    localStorage.setItem('technicalDocumentDetail', JSON.stringify(item));
    router.push({ path: '/lab/documents/LabDocume' });
  };

  //获取管理类文档
  const getManageDocumentList = async () => {
    let result = await manageDocument();
    if (result.code === 200) {
      manageDocumentList.value = result.result.records;
      if (result.result.records.length > 0) {
        result.result.records.forEach((item, index) => {
          if (item.displayName != '' && item.displayName != null) {
            let newArr = [];
            newArr = item.displayName.split('/');
            if (newArr[newArr.length - 1]) {
              manageDocumentList.value[index].displayName = newArr[newArr.length - 1];
              manageDocumentList.value[index].fileType = newArr[newArr.length - 1].split('.').pop();
            }
          }
        });
      }
    }
  };
  //获取技术类文档
  const getTechnicalDocumentList = async () => {
    let result = await technicalDocument();
    if (result.code === 200) {
      technicalDocumentList.value = result.result.records;
      if (result.result.records.length > 0) {
        result.result.records.forEach((item, index) => {
          if (item.displayName != '' && item.displayName != null) {
            let newArr = [];
            newArr = item.displayName.split('/');
            if (newArr[newArr.length - 1]) {
              technicalDocumentList.value[index].displayName = newArr[newArr.length - 1];
              technicalDocumentList.value[index].fileType = newArr[newArr.length - 1].split('.').pop();
            }
          }
        });
      }
    }
  };

  interface Value {
    value?: string;
    label?: string;
  }
  const router = useRouter();
  let calendarValue = ref<Moment>();
  let calendarDate = new Date();
  let calendarYear = ref(calendarDate.getFullYear());
  let calendarMouth = ref(calendarDate.getMonth() + 1);
  let personalWorkloadList = ref<any>([]);
  let userInfoList:any = useUserStore();
  const flag1 = <String>'1';
  const flag2 = <String>'2';
  // 每月实验数
  let monthNumberList = ref<any>([]);
  // 每月试验时间
  let monthTimeList = ref<any>([]);
  //通知公告
  let noticeInfoList = ref<any>([]);
  // 消息通知
  let messageInfoList = ref<any>([]);
  // 当月待办任务列表
  let todoTasksList = ref<any>([]);
  // 当天待办任务列表
  let currentDateTodoTasksList = ref<any>([]);
  //統計图下拉
  //下拉框
  let options = ref<any>([]);
  //获取当前年
  let date = new Date();
  let year = date.getFullYear();
  let value = ref<Value>({ value: date.getFullYear() });
  for (let i = 0; i < 10; i++) {
    options.value.push({
      value: year,
      label: year,
    });
    year--;
  }
  const handleChange = (value: Value) => {
    getchartInfoList(value.value);
  };
  //获取统计信息
  const getStatisticsList = async () => {
    let params = {
      userId: userInfoList.userInfo.id,
      year: calendarYear.value,
    };
    let result = await getStatisticsInfo(params);
    if (result.success === true) {
      personalWorkloadList.value = result.result;
      monthNumberList.value = result.result.mapNum;
      monthTimeList.value = result.result.mapTime;
    }
  };
  // 获取通知公告
  const getNoticeInfoList = async () => {
    const result = await getNoticeInfo();
    if (result.success === true) {
      noticeInfoList.value = result.result.records;
    }
  };
  //获取消息通知
  const getMessageInfoList = async () => {
    const result = await getMessageInfo();
    if (result.success === true) {
      messageInfoList.value = result.result.records;
    }
  };
  //获取右侧待办任务
  let currentDate = moment(new Date()).format('YYYY-MM-DD');
  currentDate = currentDate + ' 00:00:00';
  const getTodoTasksInfoList = async (date) => {
    let params = {
      date: date,
    };
    const result = await getTodoTasksInfo(params);
    if (result.success === true) {
      todoTasksList.value = result.result;
      getTodoTasksInfoDateList(currentDate);
    }
  };
  const getListData = (value: Moment) => {
    let listData;
    if (value.month() + 1 == calendarMouth.value) {
      if (todoTasksList.value) {
        todoTasksList.value.forEach((item) => {
          let hasDataDate = parseInt(item.dateTime.split('-')[2]);
          if (value.date() == hasDataDate) {
            let arrevery = item.notifyList.every((value) => {
              return value.finish === 1;
            });
            listData = arrevery ? [{ type: 'success', content: '' }] : [{ type: 'error', content: '' }];
          }
        });
      }
    }
    return listData || [];
  };

  //点击日历上日期日期事件回调
  const getTodoTasksInfoDateList = (date) => {
    date = date.split(' ')[0];
    currentDateTodoTasksList.value = [];
    todoTasksList.value.forEach((item) => {
      if (item.dateTime === date) {
        currentDateTodoTasksList.value = item.notifyList;
      }
    });
  };

  const init = () => {
    getStatisticsList();
    getNoticeInfoList();
    getMessageInfoList();
    getTodoTasksInfoList(currentDate);
    getTodoTasksInfoDateList(currentDate);
    getManageDocumentList();
    getTechnicalDocumentList();
    getHasCommonFunctionsList();
  };
  init();
  //点击统计图年份选择修改数据
  const getchartInfoList = async (year) => {
    let parmas = {
      year: year,
    };
    let result = await getStatisticsInfoList(parmas);
    if (result.success === true) {
      monthNumberList.value = result.result.mapNum;
      monthTimeList.value = result.result.mapTime;
    }
  };
  //点击日历的日期事件回调
  const changeDate = (value: Moment) => {
    calendarYear.value = value.$y;
    calendarMouth.value = value.$M + 1;
    let calendarDay = value.$D;
    let dateText = calendarYear.value + '-' + calendarMouth.value + '-' + calendarDay + ' 00:00:00';
    dateText = moment(dateText).format('YYYY-MM-DD');
    dateText = dateText + ' 00:00:00';
    getTodoTasksInfoDateList(dateText);
  };
  //点击消息更多进入消息列表页
  const gotoMessageList = () => {
    router.push('/lab/notify');
  };
  //点击通知公告更多进入通知公告列表
  const gotoNoticeInfoList = () => {
    router.push('/lab/notice');
  };
  //点击日历上的更多事件回调
  const gotodoTasksList = () => {
    router.push({ path: '/lab/notify/items' });
  };
  // 点击日历下待办任务事件回调
  const goItems = (item) => {
    localStorage.setItem('todoList', JSON.stringify(item));
    router.push({ path: '/lab/notify/items', query: { id: item.id, yn: true } });
  };
  //点击消息通知进详情事件回调
  const goMessageDetail = async (item) => {
    await update({ id: item.id });
    await getMessageInfoList();
    if (item.notTitlle === '报告审核') {
      let query = {
        id: item.entrustId,
        type: item.notTitlle,
        yn: true,
      };
      router.push({ path: '/lab/itemsReport/LabItemReporA', query: query });
    } else if (item.notTitlle === '报告批准') {
      let query = {
        id: item.entrustId,
        type: item.notTitlle,
        yn: true,
      };
      router.push({ path: '/lab/itemsReport/LabItemReporB', query: query });
    } else {
      let query:any = {
        id: item.id,
        type: item.notTitlle,
        yn: true,
      };
      localStorage.setItem('noticeList', JSON.stringify(item));
      router.push({ path: '/lab/notify', query: query });
    }
  };
  //点击通知公告进详情事件回调
  const gotoNoticeDetail = (id) => {
    router.push({ path: '/lab/notice', query: { id: id, yn: true } });
  };
</script>
<style scoped lang="less">
  :deep(.ant-modal) {
    height: 800px;
  }
  p {
    margin-bottom: 0;
  }
  .leaderBox{
    width: 100%;
  }

  .contentBox {
    // padding: 16px;
  }

  :deep(.ant-card) {
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(131, 118, 112, 0.15);

    .ant-card-body {
      padding: 0px;
    }
  }

  .leftInfo {
    background: #f5f5f5;
  }
  .commonFunctions {
    margin-bottom: 16px;
    background: #fff;
    padding: 16px 8px;
  }
  .commonFunctionsList {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    margin-bottom: 0px;
    overflow: auto;
  }
  .commonFunctionsInfo,
  .addNewFunctions {
    margin: 0 40px;
    font-size: 14px;
    // background: #009688;
    color: #574a46;
    display: flex;
    align-items: center;
    // padding: 0 10px;
    justify-content: center;
    text-align: center;
    border-radius: 12px;
    // box-shadow: 0 10px 10px rgba(133, 133, 133, 0.2);
  }
  .addNewFunctionsIcon {
    font-size: 36px;
    font-weight: bold;
    color: #fff;
  }
  .routerLink,
  .addNewFunctionsInfo {
    color: #574a46;
    font-size: 14px;
    line-height: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: max-content;
    .commonFunctionsTag {
      width: 52px;
      height: 52px;
      border-radius: 12px;
      background-color: #afeee8;
      box-shadow: inset 0 -4px 16px 0 rgba(255, 255, 255, 0.8);
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .routerLinkIcon {
      color: #009688;
      font-size: 26px;
      font-weight: bold;
      // background:#009688;
      // box-shadow: 0 2px 4px 0 rgba(0, 115, 104, 0.5);
    }
  }
  .addNewFunctionsInfoTag {
    margin-bottom: 5px;
    margin-top: -6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: url('/src/assets/images/home/addIcon.png') no-repeat;
    background-size: 100%;
  }
  .taskStatisticsTitle {
    font-size: 14px;
    color: #574a46;
    line-height: 20px;
    padding: 12px 16px 10px 27px;
    font-weight: bold;
    border-bottom: 1px solid #e5eaec;
    text-align: left;
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 14px;
  }

  .title-icon {
    width: 3px;
    height: 18px;
    background: #009688;
    position: absolute;
    left: 16px;
  }

  .moreLink {
    font-size: 12px;
    color: #999ca0;
    position: absolute;
    right: 16px;
  }

  .taskStatistics {
    // padding: 14px 16px;
    box-shadow: 0 0 8px rgba(133, 133, 133, 0.2);
    border-radius: 2px;
    background: #fff;

    .taskStatisticsTitle {
      padding: 15px 16px 8px 24px;
      margin-bottom: 0px;
    }

    .counting {
      padding: 20px 16px 8px 16px;

      .countBox {
        // padding: 0 8px;
        border-radius: 12px;
        width: 100%;
        height: 100px;
        display: flex;
      }

      .green {
        background: linear-gradient(to right, #96e7de, #82dbd1);
      }

      .yellowGreen {
        background: linear-gradient(to right, #e5e7a7, #d5d779);
      }

      .blue {
        background: linear-gradient(to right, #a3dde9, #67d0e7);
      }

      .averageBox {
        flex: 1;
        display: flex;
        padding: 12px 0% 12px 8%;
        align-items: center;

        .leftContentIcon {
          width: 48px;
          height: 48px;
          margin-right: 16px;
        }

        .centerContentInfo {
          .centerContentInfoText {
            font-size: 12px;
            color: #289a8c;
            font-weight: bold;
            line-height: 20px;
            margin-bottom: 16px;
          }

          .centerContentInfoNumber {
            font-size: 24px;
            color: #0a7165;
            font-weight: bold;
            line-height: 36px;
            display: flex;
            align-items: center;

            .unit {
              font-size: 14px;
              color: #6f720b;
              font-weight: normal;
              display: inline-block;
              line-height: 20px;
              margin: 7px 0 0 4px;
            }
          }
        }

        .tobeTestIcon {
          background: url('/@/assets/images/home/toBeTest-icon.png') no-repeat;
          background-size: 100% auto;
        }

        .currentTextIcon {
          background: url('/@/assets/images/home/currentTest-icon.png') no-repeat;
          background-size: 100% auto;
        }

        .currentTestTimeIcon {
          background: url('/@/assets/images/home/currentTestTime-icon.png') no-repeat;
          background-size: 100% auto;
        }

        .currentWorkOvertimeIcon {
          background: url('/@/assets/images/home/current-work-overtime-icon.png') no-repeat;
          background-size: 100% auto;
        }

        .accumulateTestIcon {
          background: url('/@/assets/images/home/accumulate-test-icon.png') no-repeat;
          background-size: 100% auto;
        }

        .accumulateTestTimeIcon {
          background: url('/@/assets/images/home/accumulate-test-time-icon.png') no-repeat;
          background-size: 100% auto;
        }
      }
    }

    .taskBox {
      display: flex;
      padding: 24px 20px 10px 20px;
      // height: 339px;
      box-sizing: border-box;
      // padding-top: 60px;
      position: relative;
    }

    .selectInfo {
      position: absolute;
      top: 10px;
      right: 20px;
      // left: 0;
      margin: auto auto;
      z-index: 99;
      width: 100px;
    }

    .taskProcess {
      flex: 1;
      margin-right: 30px;
    }

    .taskCompleted {
      flex: 1;
    }

    .echarts {
      margin-top: 15px;
      width: 100;
    }

    #mychart,
    #mychartPie {
      width: 100%;
      height: 250px;
    }

    .titleText {
      font-size: 14px;
      line-height: 22px;
      font-weight: bold;
      color: #54504f;
      position: relative;
      padding-left: 16px;
      text-align: left;
    }

    .titleText::before {
      content: '';
      width: 4px;
      height: 22px;
      background: #37a9a7;
      display: inline-block;
      position: absolute;
      top: 0;
      bottom: 0;
      margin: auto;
      left: 0;
    }
  }

  .bottomOtherInfo {
    margin: 16px 0 0 0;
    display: flex;
    flex-direction: row;
    padding-bottom: 10px;
    // .messageRelated,
    // .documentCenter {
    //   width: 50%;
    // }

    .warnInfo {
      flex: 1;
      margin-right: 13px;
      // min-height: 426px;
      // padding: 14px 16px;
      box-shadow: 0 0 8px rgba(133, 133, 133, 0.2);
      border-radius: 2px;
      background: #fff;
      width: 100%;
      height: 220px;
      overflow: hidden;
    }

    .noticeAnnouncement {
      flex: 1;
      // height: 426px;
      // padding: 14px 16px;
      box-shadow: 0 0 8px rgba(133, 133, 133, 0.2);
      border-radius: 2px;
      background: #fff;
      height: 220px;
      overflow: hidden;
    }

    .infoList {
      padding: 0px 16px 8px 16px;
      list-style: none;
      text-align: left;
      width: 100%;
      margin-bottom: 0;
      height: 180px;
      overflow: hidden;

      .infoItem {
        font-size: 14px;
        color: #727477;
        line-height: 22px;
        margin-bottom: 10px;
        width: 100%;
        position: relative;
        cursor: pointer;

        .leftText {
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
          width: 72%;
        }
      }

      .rightTime {
        color: #b4b8bd;
        margin-left: 20px;
        font-size: 14px;
        text-align: right;
        font-weight: normal;
        // width: 100px;
        position: absolute;
        right: 0;
        top: 0;
      }

      .unread {
        color: #009688;
      }

      .read {
        color: #727477;
      }

      .branchNotice {
        color: #f78a32;
      }

      .notice {
        color: #009688;
      }
    }
    .documentCenter {
      margin-left: 13px;
      background: #fff;
      box-sizing: border-box;
      // padding:10px;
      box-shadow: 0 0 8px rgba(133, 133, 133, 0.2);
      border-radius: 2px;
      height: 220px;
      overflow: hidden;
      flex: 1;
    }
  }
  :deep(.ant-tabs > .ant-tabs-nav) {
    padding-left: 20px;
  }
  .documentCenter :deep(.ant-tabs-tab) {
    line-height: 18px;
    padding: 12px 19px;
  }
  .documentCenter :deep(.ant-tabs-tab-active) {
    background: linear-gradient(to bottom, rgba(0, 150, 136, 0.3) 0%, rgba(0, 150, 136, 0) 80%, rgba(255, 255, 255, 1));
  }
  .documentCenter :deep(.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn) {
    font-weight: bold;
  }
  .documentCenter :deep(.ant-tabs-ink-bar) {
    width: 80px;
    height: 4px;
    top: 0;
  }

  .rightInfo {
    // padding: 14px 16px;
    box-shadow: 0 0 8px rgba(133, 133, 133, 0.2);
    border-radius: 2px;
    background: #fff;

    .lineBorder {
      margin: 0 16px;
      // background: #d5dfea;
      border-top: 1px solid #d5dfea;
    }

    .taskList {
      width: 100%;
      padding: 10px 16px 30px 16px;
      height: 47.3vh;
      overflow: auto;
      border-radius: 0 0 2px 2px;

      .taskItem {
        margin-top: 20px;
        width: 100%;
        padding: 11px 22px 10px 24px;
        margin-bottom: 20px;
        border-radius: 12px;
        position: relative;
        min-height: 86px;
        cursor: pointer;
        background: linear-gradient(to right, #fdf8f2, #fdf8f2);

        &:last-child {
          margin-bottom: 0;
        }

        .leftLineIcon {
          position: absolute;
          width: 10px;
          height: 100%;
          background: #000;
          border-radius: 12px 0 0 12px;
          left: 0;
          top: 0;
          background: linear-gradient(to bottom, rgba(247, 168, 50, 0.47), rgba(247, 138, 50, 1));
        }

        // &.finishTask {
        //   background: linear-gradient(to right, #fdf8f2, #fdf8f2);
        //   .leftLineIcon {
        //     background: linear-gradient(to bottom, rgba(247, 168, 50, 0.47), rgba(247, 138, 50, 1));
        //   }
        // }

        /* 选择偶数个元素 */
        &.finishTask {
          background: linear-gradient(to right, #ecf8f6, #f1fbf9);

          .leftLineIcon {
            background: linear-gradient(to bottom, rgba(179, 233, 200, 1), rgba(0, 150, 136, 1));
          }

          .headInfo {
            .deliveryTimeIcon {
              width: 16px;
              height: 16px;
              background: url('/@/assets/images/home/iconfont-gou.png') no-repeat;
              background-size: 100% auto;
            }
          }
        }
      }

      .projectTitle {
        font-size: 18px;
        color: #464e57;
        line-height: 28px;
        font-weight: bold;
        margin-right: 16px;
      }

      .taskType {
        font-size: 14px;
        line-height: 20px;
        padding: 4px 14px;
        border-radius: 12px;
      }

      .headInfo {
        display: flex;
        padding: 0 0 4px 0;
        align-items: center;

        .deliveryTimeIcon {
          display: inline-block;
          width: 16px;
          height: 16px;
          background: url('/@/assets/images/home/time-icon.png') no-repeat;
          background-size: 100% auto;
        }

        .deliveryTime {
          font-size: 12px;
          color: #b4b8bd;
          line-height: 18px;
          margin-left: 8px;
        }
      }

      .nodataStatus {
        width: 100%;
        height: 140px;
        background: url('/@/assets/images/home/blank-bg.png') no-repeat;
        background-position: left;
        background-size: 100% 100%;
        margin-top: 24px;
        display: flex;
        align-items: center;

        p {
          font-size: 14px;
          color: #009688;
          margin-left: 10px;
        }
      }

      .otherInfo {
        padding-right: 16px;
        line-height: 20px;
        color: #727477;
        font-size: 14px;
      }
    }
  }

  /**日历相关 */
  .weekly-calendar {
    width: 100%;
    margin: 0 auto;
    font-family: '微软雅黑';
    margin-top: 20px;
    // border-bottom: 1px solid #d5dfea;
  }

  .timeShowText {
    padding-left: 24px;
    font-weight: bold;
    font-size: 14px;
    color: #727477;
  }

  :deep(.ant-picker-calendar .ant-picker-panel) {
    border-top: none;
  }

  :deep(.ant-picker-calendar .ant-picker-panel .ant-picker-body) {
    padding: 8px;
  }

  :deep(.ant-picker-date-panel .ant-picker-content th) {
    color: #999ca0;
  }

  :deep(.ant-picker-cell-in-view) {
    color: #727272;
  }

  .events {
    position: absolute;
    right: -6px;
    top: -9px;
    z-index: 3;

    .waitTodoTag {
      font-size: 8px;
      width: 12px;
      height: 12px;
      line-height: 12px;
      color: #fff;
      background: #d23535;
      border-radius: 50%;
      display: inline-block;
      text-align: center;
      background: url('/src/assets/images/home/waitTodo_icon.png') no-repeat;
      background-size: 100% 100%;
    }
  }

  :deep(.ant-badge-status-dot) {
    top: -3px;
    left: 0;
    right: 0;
    margin: auto;
    width: 4px;
    height: 4px;
  }

  :deep(.ant-badge-status-text) {
    display: none;
  }

  :deep(.ant-picker-cell .ant-picker-cell-inner) {
    width: 24px;
    height: 24px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: auto;
    border-radius: 4px;
    border: 1px solid transparent;
  }

  :deep(.ant-picker-cell-selected .ant-picker-cell-inner) {
    color: #009688;
    background: #fff;
    border: 1px solid #009688;
  }

  :deep(.ant-picker-cell-today .ant-picker-cell-inner) {
    color: #fff;

    &::before {
      background: #009688;
      border-radius: 4px;
    }

    .ant-picker-calendar-date-value {
      position: relative;
      z-index: 2;
    }

    .ant-badge-status-success {
      background: #fff;
    }
  }

  @media screen and (min-width: 768px) and (max-width: 1720px) {
    .taskStatistics .counting .averageBox {
      padding: 12px 0% 12px 5%;
    }

    .taskStatistics .counting .averageBox .centerContentInfo .centerContentInfoText {
      margin-bottom: 0px;
    }
  }

  @media screen and (max-width: 998px) {
    .taskBox {
      flex-direction: column;
    }
  }
</style>
